agents.anac.y2011.Nice_Tit_for_Tat
Class NiceTitForTat

java.lang.Object
  extended by negotiator.Agent
      extended by agents.anac.y2011.Nice_Tit_for_Tat.BilateralAgent
          extended by agents.anac.y2011.Nice_Tit_for_Tat.NiceTitForTat
All Implemented Interfaces:
BidHistoryKeeper

public class NiceTitForTat
extends BilateralAgent

Tit for tat agent with opponent learning

Author:
Tim Baarslag

Field Summary
 
Fields inherited from class agents.anac.y2011.Nice_Tit_for_Tat.BilateralAgent
domain, myHistory, opponentHistory
 
Fields inherited from class negotiator.Agent
fNegotiation, parametervalues, sessionNr, sessionsTotal, startTime, strategyParameters, timeline, totalTime, utilitySpace
 
Constructor Summary
NiceTitForTat()
           
 
Method Summary
 Bid chooseCounterBid()
          The opponent has already made a bid.
 Bid chooseFirstCounterBid()
          Use this method to make the first counter-bid.
 Bid chooseOpeningBid()
          Use this method to make an opening bid.
 java.lang.String getName()
           
static java.lang.String getVersion()
           
 void init()
          This method is called by the protocol every time before starting a new session after the internalInit method is called.
 boolean isAcceptable(Bid plannedBid)
          At some point, one of the parties has to accept an offer to end the negotiation.
protected static void log(java.lang.String s)
           
protected  Action makeAcceptAction()
          By default, if an offer is deemed acceptable, we send accept.
static double percentage(double x)
           
protected  void prepareOpponentModel()
           
static double round2(double x)
          Rounds to two decimals
static double round3(double x)
          Rounds to 3 decimals
 
Methods inherited from class agents.anac.y2011.Nice_Tit_for_Tat.BilateralAgent
chooseAction, getMyLastBid, getMySecondLastBid, getOpponentHistory, getOpponentLastBid, getRound, getUndiscountedUtility, ReceiveMessage
 
Methods inherited from class negotiator.Agent
endSession, getAgentID, getParameterValues, getSessionNumber, getSessionsTotal, getStrategyParameters, getUniqueIdentifier, getUtility, internalInit, isUIAgent, loadSessionData, parseStrategyParameters, restartDataObjectsFolder, saveSessionData, setAgentID, setName, sleep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NiceTitForTat

public NiceTitForTat()
Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class Agent
Returns:
name of the agent.

getVersion

public static java.lang.String getVersion()

init

public void init()
Description copied from class: Agent
This method is called by the protocol every time before starting a new session after the internalInit method is called. User can override this method.

Overrides:
init in class BilateralAgent

prepareOpponentModel

protected void prepareOpponentModel()

chooseCounterBid

public Bid chooseCounterBid()
Description copied from class: BilateralAgent
The opponent has already made a bid. Use this method to make an counter bid.

Specified by:
chooseCounterBid in class BilateralAgent

chooseOpeningBid

public Bid chooseOpeningBid()
Description copied from class: BilateralAgent
Use this method to make an opening bid.

Specified by:
chooseOpeningBid in class BilateralAgent

chooseFirstCounterBid

public Bid chooseFirstCounterBid()
Description copied from class: BilateralAgent
Use this method to make the first counter-bid.

Specified by:
chooseFirstCounterBid in class BilateralAgent

isAcceptable

public boolean isAcceptable(Bid plannedBid)
Description copied from class: BilateralAgent
At some point, one of the parties has to accept an offer to end the negotiation. Use this method to decide whether to accept the last offer by the opponent.

Specified by:
isAcceptable in class BilateralAgent

makeAcceptAction

protected Action makeAcceptAction()
Description copied from class: BilateralAgent
By default, if an offer is deemed acceptable, we send accept. Overwrite this method to change this behaviour.

Overrides:
makeAcceptAction in class BilateralAgent

log

protected static void log(java.lang.String s)

round2

public static double round2(double x)
Rounds to two decimals


round3

public static double round3(double x)
Rounds to 3 decimals


percentage

public static double percentage(double x)